package com.ruoyi.web.controller.teacher;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.BasisCaseLoadingTask;
import com.ruoyi.domain.BasisEvent;
import com.ruoyi.domain.Basislabel;
import com.ruoyi.service.BasisEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author yichaofan
 * date 2025/5/27
 */
@RestController
@RequestMapping("/event")
public class BasisEventController extends BaseController {

    @Autowired
    BasisEventService eventService;
    /**
     * 查询事件及标注信息
     */
    @GetMapping("/list")
    public R<List<BasisEvent>> list(String loadingId)
    {
        List<BasisEvent> basisEvents = eventService.selectEventByLoadingId(loadingId);
        return R.ok(basisEvents);
    }

    /**
     * 插入事件信息
     * @param event
     */
    @PostMapping("/insertEvent")
    public R<Long> insertEvent(BasisEvent event)
    {
        eventService.insertEvent(event);
        return R.ok(event.getId());
    }
    @PostMapping("/updateEvent")
    public R updateEvent(BasisEvent event)
    {
        eventService.updateEvent(event);
        return R.ok();
    }
    @PostMapping("/{ids}")
    public R deleteEvent(@PathVariable Long[] ids)
    {
        eventService.deleteEvent(ids);
        return R.ok();
    }
}
